import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:shop/test/CameraScreen.dart';
import 'package:shop/test/CustomScroll.dart';
import 'package:shop/test/DrawerScreen.dart';
import 'package:shop/test/FlipCardScreen.dart';
import 'package:shop/test/LoadingScreen.dart';
import 'package:shop/test/RatingBarScreen.dart';
import 'package:shop/test/SlidableScreen.dart';
import 'package:shop/test/SliverListTwoScreen.dart';
import 'package:shop/test/SliverListOneScreen.dart';
import 'package:shop/test/SliverListThreeScreen.dart';
import 'package:shop/test/SwiperScreen.dart';
import 'package:shop/test/record_page.dart';

//培训
class TrainScreen extends StatelessWidget {
  bool isButtonDisable = false;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('培训/认证'),
        centerTitle: true,
      ),
      body: Scrollbar(
          controller: ScrollController(),
          child: SingleChildScrollView(
            child: Column(
              //crossAxisAlignment: CrossAxisAlignment.stretch,
              children: <Widget>[
                Container(
                  padding: EdgeInsets.all(5.0),
                  child: ButtonTheme(
                    minWidth: 200.0,
                    height: 50.0,
                    //RaisedButton悬浮按钮
                    child: RaisedButton(
                        //按钮的阴影
                        elevation: 2.0,
                        //按下时的阴影
                        highlightElevation: 8.0,
                        //禁用时的阴影
                        disabledElevation: 0.0,
                        child: Text(("跳转到导航叠加页面")),
                        //按钮颜色
                        color: Colors.blue,
                        //按下时的按钮颜色
                        highlightColor: Colors.blue[700],
                        onPressed: () {
                          Navigator.push(
                              context,
                              MaterialPageRoute(
                                  builder: (context) => CustomScroll()));
                        }),
                  ),
                ),

                Container(
                  padding: EdgeInsets.all(5),
                  child: SizedBox(
                    width: double.infinity,
                    height: 50.0,
                    child: FlatButton(
                      child: Text(("禁止点击按钮的效果")),
                      //按钮颜色
                      color: Colors.blue,
                      //按下时的按钮颜色
                      highlightColor: Colors.blue[700],
                      //禁用时按钮的颜色
                      disabledColor: Colors.grey,
                      //禁用时文本的颜色
                      disabledTextColor: Colors.grey[700],
                      //按钮的外形
                      shape: RoundedRectangleBorder(
                          borderRadius: BorderRadius.circular(20.0)),
                      //点击按钮的水波纹
                      splashColor: Colors.black12,
                      //按钮主题颜色
                      colorBrightness: Brightness.dark,
                      onPressed: null,
                    ),
                  ),
                ),

                Container(
                  padding: EdgeInsets.all(5),
                  child: SizedBox(
                    width: double.infinity,
                    height: 50.0,
                    child: OutlineButton(
                      //按下时的阴影
                        highlightElevation: 8.0,
                        child: Text(("跳转到有抽屉显示")),
                        //按钮颜色
                        color: Colors.blue,
                        //按下时的按钮颜色
                        highlightColor: Colors.blue[700],
                        onPressed: () {
                          Navigator.push(
                              context,
                              MaterialPageRoute(
                                  builder: (context) => DrawerScreen()));
                        }),
                  ),
                ),

                Container(
                  padding: EdgeInsets.all(5),
                  child: SizedBox(
                    width: double.infinity,
                    height: 50.0,
                    child: OutlineButton(
                      //按下时的阴影
                        highlightElevation: 8.0,
                        child: Text(("跳转到带header的列表1")),
                        //按钮颜色
                        color: Colors.blue,
                        //按下时的按钮颜色
                        highlightColor: Colors.blue[700],
                        onPressed: () {
                          Navigator.push(
                              context,
                              MaterialPageRoute(
                                  builder: (context) => SliverListOneScreen()));
                        }),
                  ),
                ),

                Container(
                  padding: EdgeInsets.all(5),
                  child: SizedBox(
                    width: double.infinity,
                    height: 50.0,
                    child: OutlineButton(
                      //按下时的阴影
                        highlightElevation: 8.0,
                        child: Text(("跳转到带header的列表2")),
                        //按钮颜色
                        color: Colors.blue,
                        //按下时的按钮颜色
                        highlightColor: Colors.blue[700],
                        onPressed: () {
                          Navigator.push(
                              context,
                              MaterialPageRoute(
                                  builder: (context) => SliverListTwoScreen()));
                        }),
                  ),
                ),

                Container(
                  padding: EdgeInsets.all(5),
                  child: SizedBox(
                    width: double.infinity,
                    height: 50.0,
                    child: OutlineButton(
                      //按下时的阴影
                        highlightElevation: 8.0,
                        child: Text(("跳转到带header的列表3")),
                        //按钮颜色
                        color: Colors.blue,
                        //按下时的按钮颜色
                        highlightColor: Colors.blue[700],
                        onPressed: () {
                          Navigator.push(
                              context,
                              MaterialPageRoute(
                                  builder: (context) => SliverListThreeScreen()));
                        }),
                  ),
                ),

                Container(
                  padding: EdgeInsets.all(5),
                  child: IconButton(
                      //按钮中的图片
                      icon: Icon(Icons.accessibility_new),
                      iconSize: 24.0,
                      //按钮颜色
                      color: Colors.blue,
                      //按下时的按钮颜色
                      highlightColor: Colors.blue[700],
                      onPressed: () {
                        Navigator.push(
                            context,
                            MaterialPageRoute(
                                builder: (context) => CustomScroll()));
                      }),
                ),

                Container(
                  padding: EdgeInsets.all(5),
                  child: SizedBox(
                    height: 50.0,
                    child: OutlineButton.icon(
                        //按钮中的图片
                        icon: Icon(Icons.send),
                        //按钮颜色
                        color: Colors.blue,
                        //按下时的按钮颜色
                        highlightColor: Colors.blue[700],
                        //文字内容
                        label: Text("发送"),
                        onPressed: () {
                          Navigator.push(
                              context,
                              MaterialPageRoute(
                                  builder: (context) => CustomScroll()));
                        }),
                  ),
                ),

//          BoxDecoration({
//            Color color, //颜色
//            DecorationImage image,//图片
//            BoxBorder border, //边框
//            BorderRadiusGeometry borderRadius, //圆角
//            List<BoxShadow> boxShadow, //阴影,可以指定多个
//            Gradient gradient, //渐变
//            BlendMode backgroundBlendMode, //背景混合模式
//            BoxShape shape = BoxShape.rectangle, //形状
//          })
                DecoratedBox(
                  decoration: BoxDecoration(
                      gradient: LinearGradient(
                          colors: [Colors.red, Colors.orange[700]]
                      ),
                      borderRadius: BorderRadius.circular(3.0),
                      boxShadow: [
                        BoxShadow(
                          color: Colors.black54,
                          offset: Offset(2.0, 2.0),
                          blurRadius: 4.0,
                        )
                      ]),
                  child: Padding(
                    padding:
                        EdgeInsets.symmetric(horizontal: 80.0, vertical: 18.0),
                    child: Text(
                      "颜色渐变按钮",
                      style: TextStyle(color: Colors.white),
                    ),
                  ),
                ),

                SizedBox(height: 10.0,),

                Ink(
                  padding: EdgeInsets.all(15.0),
                  decoration: BoxDecoration(
                      gradient: LinearGradient(
                          colors: [Colors.red, Colors.orange[700]]
                      ),
                      borderRadius: BorderRadius.circular(3.0),
                      boxShadow: [
                        BoxShadow(
                          color: Colors.red[500],
                          offset: Offset(2.0, 2.0),
                          blurRadius: 4.0,
                        )
                      ]),

                  child: InkResponse(
                    child: Text('点击调用相机'),
                    onTap: ()=> Navigator.push(
                        context,
                        MaterialPageRoute(
                            builder: (context) => CameraScreen())),
                  ),
                ),

                SizedBox(height: 10.0,),

                Ink(
                  padding: EdgeInsets.all(15.0),
                  decoration: BoxDecoration(
                      gradient: LinearGradient(
                          colors: [Colors.red, Colors.orange[700]]
                      ),
                      borderRadius: BorderRadius.circular(3.0),
                      boxShadow: [
                        BoxShadow(
                          color: Colors.red[500],
                          offset: Offset(2.0, 2.0),
                          blurRadius: 4.0,
                        )
                      ]),

                  child: InkResponse(
                    child: Text('各种样式的轮播图'),
                    onTap: ()=> Navigator.push(
                        context,
                        MaterialPageRoute(
                            builder: (context) => SwiperScreen())),
                  ),
                ),

                SizedBox(height: 10.0,),

                Container(
                  padding: EdgeInsets.all(5),
                  child: SizedBox(
                    width: double.infinity,
                    height: 50.0,
                    child: OutlineButton(
                      //按下时的阴影
                        highlightElevation: 8.0,
                        child: Text(("跳转到FlipCard页面")),
                        //按钮颜色
                        color: Colors.blue,
                        //按下时的按钮颜色
                        highlightColor: Colors.blue[700],
                        onPressed: () {
                          Navigator.push(
                              context,
                              MaterialPageRoute(
                                  builder: (context) => FlipCardScreen()));
                        }),
                  ),
                ),

                SizedBox(height: 10.0,),

                Container(
                  padding: EdgeInsets.fromLTRB(20, 0, 20, 0),
                  child: SizedBox(
                    width: double.infinity,
                    height: 50.0,
                    child: OutlineButton(
                      //按下时的阴影
                        highlightElevation: 8.0,
                        child: Text(("跳转到RatingBar页面")),
                        //按钮颜色
                        color: Colors.blue,
                        //按下时的按钮颜色
                        highlightColor: Colors.blue[700],
                        onPressed: () {
                          Navigator.push(
                              context,
                              MaterialPageRoute(
                                  builder: (context) => RatingBarScreen()));
                        }),
                  ),
                ),

                SizedBox(height: 10.0,),

                Container(
                  padding: EdgeInsets.fromLTRB(20, 0, 20, 0),
                  child: SizedBox(
                    width: double.infinity,
                    height: 50.0,
                    child: OutlineButton(
                      //按下时的阴影
                        highlightElevation: 8.0,
                        child: Text(("跳转到Slidable页面")),
                        //按钮颜色
                        color: Colors.blue,
                        //按下时的按钮颜色
                        highlightColor: Colors.blue[700],
                        onPressed: () {
                          Navigator.push(
                              context,
                              MaterialPageRoute(
                                  builder: (context) => SlidableScreen()));
                        }),
                  ),
                ),

                SizedBox(height: 10.0,),

                Container(
                  padding: EdgeInsets.fromLTRB(20, 0, 20, 0),
                  child: SizedBox(
                    width: double.infinity,
                    height: 50.0,
                    child: OutlineButton(
                      //按下时的阴影
                        highlightElevation: 8.0,
                        child: Text(("跳转到加载页面")),
                        //按钮颜色
                        color: Colors.blue,
                        //按下时的按钮颜色
                        highlightColor: Colors.blue[700],
                        onPressed: () {
                          Navigator.push(
                              context,
                              MaterialPageRoute(
                                  builder: (context) => LoadingScreen()));
                        }),
                  ),
                ),

                SizedBox(height: 10.0,),

                Container(
                  padding: EdgeInsets.fromLTRB(20, 0, 20, 0),
                  child: SizedBox(
                    width: double.infinity,
                    height: 50.0,
                    child: OutlineButton(
                      //按下时的阴影
                        highlightElevation: 8.0,
                        child: Text(("跳转到录音页面")),
                        //按钮颜色
                        color: Colors.blue,
                        //按下时的按钮颜色
                        highlightColor: Colors.blue[700],
                        onPressed: () {
                          Navigator.push(
                              context,
                              MaterialPageRoute(
                                  builder: (context) => RecordPage()));
                        }),
                  ),
                ),

                SizedBox(height: 10.0,),
              ],
            ),
          )),
    );
  }
}
